package com.zhiyou100.review.day021;

import cn.hutool.core.io.IoUtil;

import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

/**
 * @packageName: MySocketClient
 * @className: com.zhiyou100.review.day021
 * @Description: TODO 客户端
 * @author: yang
 * @date: 7/2/20
 */
public class MySocketClient {
    private static final String PATH = "/Users/yang/Downloads/test/send/a.txt";
    private static final String IP="127.0.0.1";
    private static final int PORT=10086;

    public static void main(String[] args) throws Exception {
        File file = new File(PATH);
        FileOutputStream fileOutputStream = new FileOutputStream(file);

        Socket socket = new Socket(IP, PORT);

        OutputStream outputStream = socket.getOutputStream();
        InputStream inputStream = socket.getInputStream();
        // 获取 客户端的 输入和输出

        IoUtil.close(socket);
    }
}
